<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>{if $title}{$title}{else}{if !empty($_W['account']['name'])}{$_W['account']['name']}{/if}{/if}</title>
        <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <meta name="format-detection" content="telephone=no" />
        <link href="./themes/mobile/style47/css/cate7_0.css" rel="stylesheet" type="text/css" />
        <link href="./themes/mobile/style47/css/iscroll.css" rel="stylesheet" type="text/css" />
         <style>
            #cate1 .mainmenu li .menubtn .menumesg {
                padding: 0;
            }
            #cate1 .mainmenu li {
                width: 33.3%;/*每个分类所占比例：一排2个就是50%*/
            }
            #cate1 .mainmenu li .menubtn {
                margin: 8px 8px 0 0;/*外边距：可根据需求调整大小；4个数字，分别是上右下左*/
            }

            #cate1 .mainmenu {
                padding: 0 0 8px 8px;/*内边距：可根据需求调整大小；4个数字，分别是上右下左*/
            }
            #cate1 .mainmenu li .menubtn {
                border-radius: 6px;/*图片圆角，越大越圆*/
            } 
        </style>
        <script src="./themes/mobile/style47/css/iscroll.js" type="text/javascript"></script>
        <script type="text/javascript">
            var myScroll;

            function loaded() {
                myScroll = new iScroll('wrapper', {
                    snap: true,
                    momentum: false,
                    hScrollbar: false,
                    onScrollEnd: function () {
                        document.querySelector('#indicator > li.active').className = '';
                        document.querySelector('#indicator > li:nth-child(' + (this.currPageX+1) + ')').className = 'active';
                    }
                });
 
 
            }

            document.addEventListener('DOMContentLoaded', loaded, false);
        </script>
	<style>
	#footer{padding:0; width:100%; height:40px; line-height:40px; text-align:center; color:#666; position:absolute; bottom: auto;}
	</style>
    </head>
	{php include_once IA_ROOT . '/source/modules/site/model.php'}
	{php $slide = site_article_search('', 'f');}
    <body id="cate1">
		   <div class="banner">
		<div id="wrapper">
			<div id="scroller">
				<ul id="thelist"> 
				{loop $slide['list'] $v}
						<li><p>{$v['title']}</p><a href="{php echo create_url('mobile/channel', array('name' => 'detail', 'id' => $v['id'], 'weid' => $_W['weid']))}"><img src="{$_W['attachurl']}{$v['thumb']}"/></a></li>
				{/loop}
				</ul>
			</div>
		</div>
		<div id="nav">
			<div id="prev" onclick="myScroll.scrollToPage('prev', 0,400,3);return false">&larr; prev</div>
			<ul id="indicator">
			{php $slideNum = 1;}
			{loop $slide['list'] $vv}
				<li{if $slideNum == 1} class="active"{/if}></li>
				{php $slideNum++;}
			{/loop}
			 
			</ul>
			<div id="next" onclick="myScroll.scrollToPage('next', 0);return false">next &rarr;</div>
		</div>
		<div class="clr"></div>
		</div>
        <div id="insert1"></div>
        <ul class="mainmenu">
               {loop $navs $nav}	
                <li>
                    <div class="menubtn">
                        <a href="{$nav['url']}">
                            <div class="menumesg">
                                <div class="menuimg"><img src="{$_W['attachurl']}{$nav['icon']}" /></div>
                                <div class="menutitle">{$nav['name']}</div>
                            </div>
                        </a>
                    </div>
                </li>
                {/loop}	


            <div class="clr"></div>
        </ul>
        <script>
            var count = document.getElementById("thelist").getElementsByTagName("img").length;	

            var count2 = document.getElementsByClassName("menuimg").length;
            for(i=0;i<count;i++){
                document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:"+document.body.clientWidth+"px";

            }
            document.getElementById("scroller").style.cssText = " width:"+document.body.clientWidth*count+"px";

            setInterval(function(){
                myScroll.scrollToPage('next', 0,400,count);
            },3500 );
            window.onresize = function(){ 
                for(i=0;i<count;i++){
                    document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:"+document.body.clientWidth+"px";

                }
                document.getElementById("scroller").style.cssText = " width:"+document.body.clientWidth*count+"px";
            } 


        </script>

        <div id="insert2"></div>
        <div style="display:none"> </div>
 
<script src="./themes/mobile/style47/css/zepto.min.js" type="text/javascript"></script>
{template 'footer'}  